.TH std::experimental::weak_ptr 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::weak_ptr \- std::experimental::weak_ptr

.SH Synopsis
   Defined in header <experimental/memory>
   template< class T > class weak_ptr;      (library fundamentals TS)

   std::experimental::weak_ptr is a modified version of std::weak_ptr that
   interoperates with std::experimental::shared_ptr and has support for arrays.

.SH Member types

   Member type  Definition
   element_type std::remove_extent_t<T>

.SH Member functions

   constructor   constructs new weak_ptr
                 \fI(public member function)\fP

Members and non-members identical to std::weak_ptr

.SH Member functions

   The following member functions work with std::experimental::shared_ptr instead of
   std::shared_ptr and std::experimental::weak_ptr instead of std::weak_ptr. The
   behavior is otherwise identical.

   destructor   destroys a weak_ptr
                \fI(public member function of std::weak_ptr<T>)\fP
   operator=    assigns the weak_ptr
                \fI(public member function of std::weak_ptr<T>)\fP
.SH Modifiers
   reset        releases the ownership of the managed object
                \fI(public member function of std::weak_ptr<T>)\fP
   swap         swaps the managed objects
                \fI(public member function of std::weak_ptr<T>)\fP
.SH Observers
   use_count    returns the number of shared_ptr objects that manage the object
                \fI(public member function of std::weak_ptr<T>)\fP
   expired      checks whether the referenced object was already deleted
                \fI(public member function of std::weak_ptr<T>)\fP
   lock         creates a shared_ptr that manages the referenced object
                \fI(public member function of std::weak_ptr<T>)\fP
   owner_before provides owner-based ordering of weak pointers
                \fI(public member function of std::weak_ptr<T>)\fP

.SH Non-member functions

   This non-member function is declared in the std::experimental namespace, and work
   with std::experimental::weak_ptr rather than std::weak_ptr, but otherwise behaves
   identically to the corresponding C++14 function.

   std::swap(std::weak_ptr) specializes the std::swap algorithm
   \fI(C++11)\fP                  \fI(function template)\fP

.SH Example

    This section is incomplete
    Reason: no example

.SH Categories:
     * Noindexed pages
     * Todo no example
